/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-07 19:40:17
*/
package com.ueboot.weishop.repository.lottery;

import com.ueboot.weishop.entity.lottery.LotteryRecordEntity;
import com.ueboot.core.repository.BaseRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by ziv  on 2017-11-07 19:40:17.
 *
 * @author ziv
 * @since 2.0 by autocode
 */
@Repository
public interface LotteryRecordRepository extends BaseRepository<LotteryRecordEntity, Long> {

	@Modifying
	@Query("UPDATE #{#entityName} oe set oe.extStatus = :extStatusSet where oe.extStatus = :extStatusWhere")
	int updateExtStatusByExtStatus(@Param("extStatusSet") Integer extStatusSet, @Param("extStatusWhere") Integer extStatusWhere);

	List<LotteryRecordEntity> findByExtStatus(Integer extStatus);
}
